package tasks.leetcode.任务调度;

import java.util.Scanner;

public class Task005 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = Integer.parseInt(scanner.nextLine());
        int length = Integer.parseInt(scanner.nextLine());
        String[] split = scanner.nextLine().split("\\s");
        int[] array = new int[split.length];
        for (int i = 0; i < array.length; i++) {
            array[i] = Integer.parseInt(split[i]);
        }
        int time = 0; // 统计次数
        int remain = 0; // 查看是否还有没有执行完的任务，需要放在下次一起 执行
        for (int i = 0; i < array.length; i++) {
            if (array[i] + remain > n) {
                remain = array[i] + remain - n;
            } else {
                remain = 0;
            }
            time++;
        }

        if (remain > 0) {
            while (remain > 0) {
                remain = remain - n;
                time++;
            }
        }
        System.out.println(time);
    }
}
